HTML Interaction with Flash

You can control two basic actions with Flash and scripting:

Controlling an Animation using a JavaScript Method

When embedding a Flash animation, the player is assigned an ID as follows:

<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0"

ID=navmovie WIDTH=100% HEIGHT=100%>

<PARAM NAME="movie" VALUE="navigation.swf">

<PARAM NAME="play" VALUE="false">

<PARAM NAME="quality" VALUE="high">

<EMBED NAME=navmovie src=navigation.swf WIDTH=100% HEIGHT=100% PLAY=false

SWLIVECONNECT=true QUALITY=high>

</OBJECT>

Examples:

var firstName = navmovie.GetVariable("FirstName");

navmovie.Play();

navmovie.Pan();

Sending a Message from an Animation to JavaScript

In the HTML page that embeds the animation, add the following JavaScript code:

function navmovie_DoFSCommand(command, args) {

if (command == "messagebox") {

alert(args);

}

}